<!--
 * @Descripttion: 
 * @Author: voanit
 * @Date: 2022-06-29 09:04:23
 * @LastEditors: voanit
 * @LastEditTime: 2022-06-29 09:13:10
-->

<template>
  <div>
    御剑乘风来,除魔天地间!BackCom==={{ obj.age }}={{ age }}
    <button @click="btn">按钮</button>
  </div>
</template>
<script>
import { reactive, toRef, toRefs } from 'vue'
export default {
  name: 'BackCom',
  setup () {
    const obj = reactive({
      age: 18,
      name: 'rose',
      gender: 1
    })

    const age = toRef(obj, 'age')

    const btn = () => {
      // obj.age += 2
      age.value += 2
      // console.log(age, 88);
    }

    return { obj, btn, age }
  }

}
</script>
<style lang='less'  scoped>
</style>